The present invention relates to information processing systems and, more particularly, to software tools and methods for monitoring, modeling, and enhancing system performance.
To enhance system performance, it is helpful to know which modules within a system are responsible, either directly or indirectly, for the most significant consumption of the most critical system resources. Effective systems management depends on knowing how and when system resources are being used. Similarly, a developer hoping to improve system performance should focus his or her efforts on improving the resource consumption characteristics of the modules which consume the largest amount of critical resources.
Performance tools are used to examine the system in order to determine resource consumption as programs execute. For example, a performance tool may identify the most frequently executed modules and instructions in a system, or may identify those modules which allocate the largest amount of memory or perform the most I/O requests. Performance tools may be implemented in hardware or software. Software performance tools may be built into the system or added at a later point in time. Performance tools implemented in software are especially usefull in systems, such as personal computer systems, that do not contain many, if any, built-in hardware performance tools. Software tools take advantage of hardware performance tools and are instrumental in understanding what is happening at the level that an analyst or program developer can understand.
One type of prior art software performance tool, referred to as a trace tool, keeps track of particular sequences of instructions by logging certain events as they occur. For example, a trace tool may log every entry into and every exit from a module, subroutine, method, function, or system component. Typically, a time stamped record is produced for each such event. Pairs of records similar to entry-exit records are also used to trace execution of arbitrary code segments, to record acquiring and releasing locks, starting and completing I/O or data transmission, and for many other events of interest.
A developer or systems manager is typically presented with a xe2x80x9ctracexe2x80x9d of the results. The trace is often stored as a text file, such as the example trace, showing entries into and exits from modules, depicted in FIG. 1. The trace in FIG. 1 shows that module xe2x80x9cCxe2x80x9d is the first module entered. Module xe2x80x9cCxe2x80x9d calls module xe2x80x9cA,xe2x80x9d module xe2x80x9cAxe2x80x9d calls module xe2x80x9cB,xe2x80x9d and so on.
FIG. 1 depicts a very small piece of a larger trace. Typically, traces are many millions of entries long. Because loops are common in programs, trace files often contain patterns of events repeated many times. The typical text file trace output may be read by a developer or systems manager, and is adequate for gaining an understanding of very small time periods within the trace. However, a text file trace output is too cumbersome to use when attempting to analyze large scale behavior and patterns contained in a trace. Furthermore, the size of the trace is limited by the buffer space allocated to store the trace. Thus, a system may be traced for a limited, and often very short, period of time.
Consequently, it would be desirable to have a system and method for providing trace information to a developer or systems manager in a compact and highly efficient manner. It would also be desirable to provide the trace information in such a way as to facilitate understanding of the system""s operation, and highlight opportunities for performance improvement.
Accordingly, the present invention is directed to a system, method, and computer readable medium for representing program event trace information in a way which is very compact and efficient, and yet supports a wide variety of queries regarding system performance. The tracing and reduction of the present invention may be dynamic, in which case information is obtained in real-time, as each event occurs, and is automatically reduced and added to the trace representation. Alternately, the tracing and reduction of the present invention may be static, in which case a trace text file or binary file is obtained from a trace buffer, and the reduction takes place using the trace file as input.
The trace information, whether obtained statically or dynamically, is represented as a tree of events. For example, the tree structure of the present invention may reflect the call stacks observed during a program""s execution. A call stack is represented by one or more nodes in the tree, and statistics regarding the time spent in the various routines and call stacks is stored at each node.
The present invention may be used to present many types of trace information in a compact manner which supports performance queries. For example, rather than keeping statistics regarding time, tracing may be used to track the number of Java bytecodes executed in each method (i.e. routine) called. The tree structure of the present invention would then contain statistics regarding bytecodes executed. Tracing may also be used to track memory allocation and deallocation. An advantage of this invention is that it is not required to store a trace record for every memory allocation or deallocation, though such an approach is possible under the present invention.
An advantage of the present invention is that trace information is presented in a manner which is compact and efficient. Another advantage is that the tree structure of the present invention may be used to quickly and easily answer a variety of performance queries. A further advantage of the present invention is that it allows a system to be traced for long periods of time without losing useful performance information due to a limited buffer space. The use of dynamic tracing and reduction, along with dynamic pruning in some cases, is especially usefull in profiling the performance characteristics of long running programs. By using dynamic tracing and reduction (and perhaps dynamic pruning), an accurate and informative performance profile may be obtained for a long running program.